import java.util.Scanner;
import java.util.Arrays;
public class TestMethod {
    public static void main(String[] args) {
        int[][] arr={
                {1,2,3,4},
                {5,6,7,8},
                {9,10,11,12}
        };
        for(int row=0;row<arr.length;row++){
            for(int col=0;col<arr[row].length;col++){
                System.out.printf("%d\t",arr[row][col]);
            }
            System.out.println(" ");
        }
    }
        /*
        int[] arr={1,2,3,4,5,6,7,8,9};
        reverse(arr);
        System.out.println(Arrays.toString(arr));
    }
    public static void reverse(int[] arr){
        int left=0;
        int right=arr.length-1;
        while(left<right){
            int tmp=arr[left];
            arr[left]=arr[right];
            arr[right]=tmp;
            left++;
            right--;
        }
    }
        /*
        int[] arr={5,6,3,2,9,78,952,10,12,15,1314};
        Arrays.sort(arr);
        System.out.println(Arrays.toString(arr));
    }
        /*
        int[] arr={1,2,3,4,5,67,8,9,52,521,520,1314};
        bubbleSort(arr);
        System.out.println(Arrays.toString(arr));
    }
    public static void bubbleSort(int[] arr){
        for(int i=0;i<arr.length;i++){
            for(int j=1;j<arr.length-i;j++){
                if(arr[j-1]>arr[j]){
                    int tmp=arr[j-1];
                    arr[j-1]=arr[j];
                    arr[j]=tmp;
                }
            }
        }
    }
        /*
        int[] arr={1,2,3,4,5,6,7,8,9,155};
        System.out.println(binarySearch(arr,155));
    }
    public static int binarySearch(int[] arr,int toFind){
        int left=0;
        int right=arr.length-1;
        while(left<=right){
            int mid=(left+right)/2;
            if(toFind<arr[mid]){
                right=mid-1;
            }else if(toFind>arr[mid]){
                left=mid+1;
            }else if(toFind==arr[mid]){
                return arr[mid];
            }
        }
        return -1;
    }
        /*
        int[] arr={1,2,3,4,5,6,7,8,9};
        System.out.println(find(arr,8));
    }
    public static int find(int[] arr,int data){
        for(int x:arr) {
            if (data == x) {
                return data;
            }
        }
        return -1;
    }
        /*
        int[] arr={1,2,3,4,5,6,7};
        System.out.println(avg(arr));
    }
    public static double avg(int[] arr){
        double sum=0;
        for(int x:arr){
            sum+=x;
        }
        return sum/(double)arr.length;
    }
        /*
        int[] arr={1,2,3,4,5,6};
        System.out.println(Arrays.toString(arr));
    }
    public static int[] copyOf(int[] arr){
        int[] ret=new int[arr.length];
        for(int i=0;i<arr.length;i++){
            ret[i]=arr[i];
        }
        return ret;
    }
        /*
        int[] arr={1,2,3,4,5};
        int[] newArr=arr;
        arr[0]=10;
        System.out.println(Arrays.toString(arr));
        System.out.println(Arrays.toString(newArr));
        int[] newArr2=Arrays.copyOfRange(arr,2,4);
        System.out.println(Arrays.toString(newArr2));
    }
        /*
        int[] arr = {1, 2, 3, 4, 5};
        int[] newArr = Arrays.copyOf(arr, arr.length);
        System.out.println(Arrays.toString(newArr));
    }
        /*
        int[] arr={1,2,3,4,5,6};
        int[] newArr=arr;
        newArr[0]=10;
        System.out.println("newArr:"+Arrays.toString(arr));
        //System.out.println(arr);
        arr[0]=10;
        System.out.println(Arrays.toString(arr));

    }
        /*
        int[] arr = {1, 2, 3, 4, 5};
        String newArr = Arrays.toString(arr);
        System.out.println(newArr);
    }
        /*
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int[] array=fib(n);
        for(int i=0;i<array.length;i++) {
            System.out.println(array[i]);
        }
    }
    public static int[] fib(int n){
        int[] array=new int[n];
        if(n<=0){
            return null;
        }else{
            array[0]=array[1]=1;
            for(int i=2;i<n;++i){
                array[i]=array[i-1]+array[i-2];
            }
            return array;
        }
    }
        /*
        int[] array={1,2,3,4,5,6,7,8,9};
        for(int x:array){
            System.out.print(x+",");
        }
    }
        /*
        int[] array={1,2,3,4,5};
        for(int i=0;i<array.length;i++){
            System.out.println(array[i]);
        }
    }
        /*
        int[] array=new int[]{10,20,3,0,40};
        System.out.println(array[0]);
        System.out.println(array[1]);
        System.out.println(array[2]);
        array[0]=100;
        System.out.println(array[0]);
    }
        /*
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入要求的项的下标");
        int right=scanner.nextInt();
        System.out.println(fib(right));
    }
    public static int fib(int n){
        int num=1;
        int sum=1;
        int tmp=1;
        for(int i=3;i<=n;i++){
            tmp=num+sum;
            num=sum;
            sum=tmp;
        }
        return tmp;
    }
        /*
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入要求的项的下标");
        int right=scanner.nextInt();
        System.out.println(fib(right));
    }
    public static int fib(int n){
        if(n==1||n==2){
            return 1;
        }else{
            return fib(n-1)+fib(n-2);
        }
    }
    */
}
